package com.carmanage.service;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Component;

import com.carmanage.dao.IEmployeesDao;
import com.carmanage.domain.Employees;
import com.carmanage.util.PageController;


@Component
public class EmployeesService {
	 @Resource
	 private IEmployeesDao iEmployeesDao;
	 private Employees employee=null;
      
	  public IEmployeesDao getEmployeesDao() {
		return iEmployeesDao;
	  }

	  public void setEmployeesDao(IEmployeesDao iEmployeesDao) {
		this.iEmployeesDao = iEmployeesDao;
	   }
	  
	  
	   public void save(Employees employ){
		 iEmployeesDao.save(employ);
	    }
	   
	   public List<Employees> showAllEmps(PageController pc){
		   List<Employees> employees=iEmployeesDao.showAllEmps(pc);
		   return employees;
		   
	   }
	   
	   public int getTotalRows(){
		  int totalRows= iEmployeesDao.getTotalRows();
		  return totalRows;
	   }
	   
	   public void deleteEmpById(int Id){
		   iEmployeesDao.deleteEmpById(Id);
	   }
	   
	   public List<Employees> groupSearch(Employees employee,PageController pc){
		   List<Employees> employees=iEmployeesDao.groupSearch(employee,pc);
		   return employees;
	   }
	   public int getGroupTotalRows(Employees employee) {
		   int TotalRows=iEmployeesDao.getGroupTotalRows(employee);
		   return TotalRows;
	   }
	   
	   public List<Object[]> getDepts(){
		   List<Object[]> depts=iEmployeesDao.getDepts();
		   return depts;
	   }
	   
	   public List<Object[]> getClasses(){
		   List<Object[]> classes=iEmployeesDao.getClasses();
		   return classes;
	   }
	   
	   public List<Object[]> getStations(){
		   List<Object[]> stations=iEmployeesDao.getStations();
		   return stations;
	   }
	   
	   public Employees showModifyData(int modifyEmpId){
		   Employees modifyEmps=iEmployeesDao.showModifyData(modifyEmpId);
		   return modifyEmps;
	   }
	   
	   public void modiEmp(int modiID, Employees employee){
		   iEmployeesDao.modiEmp(modiID, employee);
	   }

}
